package util;

import java.io.InputStream;
import java.util.Properties;

public class Res {

    public static void main(String[] args) throws Exception{

        //操作配置文件中的信息
        Properties properties = new Properties();

        //反射加载配置文件
        InputStream is = Res.class.getClassLoader().getResourceAsStream("mysql.properties");

        //使用properties对象加载输入流
        properties.load(is);
        String driver = properties.getProperty("driver");
        String url = properties.getProperty("url");
        String username = properties.getProperty("username");
        String password = properties.getProperty("password");
        System.out.println(driver);
        System.out.println(url);
        System.out.println(username);
        System.out.println(password);


    }

}
